﻿Imports System.Collections.Generic
Imports System.IO
Imports System.Linq
Imports System.Runtime.Serialization
Imports System.Text
Imports Common

Public Class Player
    Private _id As Integer? = Nothing
    Private _guid As Guid? = Nothing

    Private _room As Integer? = Nothing

    Private _character As Character = Nothing
    Private _alias As String = String.Empty

    Public Property ID As Integer?
        Get
            Return _id
        End Get
        Set(value As Integer?)
            _id = value
        End Set
    End Property

    Public Property GUID As Guid?
        Get
            Return _guid
        End Get
        Set(value As Guid?)
            _guid = value
        End Set
    End Property

    Public Property Room As Integer?
        Get
            Return _room
        End Get
        Set(value As Integer?)
            _room = value
        End Set
    End Property

    Public Property [Alias] As String
        Get
            Return _alias
        End Get
        Set(value As String)
            _alias = value
        End Set
    End Property


    Public Sub New(guid As Guid)

    End Sub

    'CRUD

    Public Shared Sub Create()

    End Sub

    Public Shared Function [Get](ID As Integer) As playerDTO
        Dim PlayerDAL As New DAL.player
        Dim PlayerDTO As playerDTO = PlayerDAL.Get(ID)

        'Validation


        'Business Rules

        Return PlayerDTO
    End Function

    Public Shared Function [Get](Username As String, Password As String) As playerDTO
        Dim PlayerDAL As New DAL.player
        Dim PlayerDTO As playerDTO = PlayerDAL.Get(Username, Password)

        '------Validation--------


        '-----Business Rules-----

        'Generate Unique ID
        Dim g As Guid = System.Guid.NewGuid
        PlayerDTO.GUID = g

        'Add Player to Global COllection
        BLL.Players.Add(PlayerDTO)

        Return PlayerDTO
    End Function

    Public Shared Sub Update()

    End Sub

    Public Shared Sub Delete()

    End Sub



End Class
